#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
    RocketWheels Track 2.0

    GUI front end for the RocketWheels race track.

    Authors:
        Andy Turner
        Jon Cole
        Brian Cole

    Copyright © 2014, RocketWheels
"""

import sys                              # some sys crap

from PySide import QtGui                # Qt4 GUI library

import app.Receiver as  Receiver        # wrapper for the processing thread
import app.Config as Config             # arg / config file getter/setter
import gui.MainWindow as MainWindow     # Main GUI window

def main():
    # create a QtGui application and create a MainWindow instance
    app = QtGui.QApplication(sys.argv)
    TrackGUI = MainWindow.RocketWheels()

    # Get config options
    configs = Config.Get()

    Receiver.Create(verbose=configs.debug)      # create THE reciever
    exit_status = app.exec_()                   # Start the main event loop
    Receiver.Destroy()                          # destroy THE receiver

    # Set exit status
    sys.exit(exit_status)

if __name__ == '__main__':
    # Run!!!
    main()
